﻿using SmartSapce.ServiceLocation;
using SmartSpace.Core;
using SmartSpace.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SmartSpace.WebApp.Modules.Core.Pages
{
    public partial class CodeCategory_Create : SsTemplatePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void _ctlBtnSave_Click(object sender, EventArgs e)
        {
            ICoreService service = ServiceLocator.Get<ICoreService>();
            CodeCategory category = new CodeCategory();
            category.Id = Guid.NewGuid();
            category.Code = _ctlEditCode.Text;
            category.Caption = _ctlEditCaption.Text;
            if (service.SaveCodeCategory(category).IsSuccess)
            {
                Response.Redirect(HyperLink1.NavigateUrl);
            }
        }
    }
}